package tech.aistar.service.impl.authordis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.authordis.NoteAuthor;
import tech.aistar.entity.authordis.Traveler;
import tech.aistar.entity.authordis.UserTable;
import tech.aistar.mapper.authordis.INoteAuthorDisMapper;
import tech.aistar.service.authordis.INoteAuthorDisService;

import java.util.List;

/**
 * Created by lenovo on 2019/9/28.
 */
@Service
@Transactional
public class NoteAuthorDisServiceImpl implements INoteAuthorDisService {

    @Autowired
    private INoteAuthorDisMapper noteAuthorDisMapper;

    @Override
    public List<Traveler> findAuthorRandom() {
        List<Traveler> traveler = noteAuthorDisMapper.findAuthorRandom();

        return traveler;
    }

    @Override
    public UserTable findUserInfoByUserId(Integer id) {
        UserTable userTable = noteAuthorDisMapper.findUserInfoByUserId(id);

        return userTable;
    }

    @Override
    public NoteAuthor findAuthorByAuthorId(Integer id) {
        NoteAuthor noteAuthor = noteAuthorDisMapper.findAuthorByAuthorId(id);
        return noteAuthor;
    }
}
